import request from '@/utils/request'

// 查询单元列表
export function listUnit(data) {
  return request({
    url: '/dormitory/dms-dormitory-unit/list?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'POST',
    data
  })
}

// 查询单元详细
export function getUnit(id) {
  return request({
    url: `/dormitory/dms-dormitory-unit/${id}`,
    method: 'get'
  })
}

// 新增单元
export function addUnit(data) {
  return request({
    url: '/dormitory/dms-dormitory-unit/add',
    method: 'post',
    data: data
  })
}

// 修改单元
export function updateUnit(data) {
  return request({
    url: '/dormitory/dms-dormitory-unit/update',
    method: 'post',
    data: data
  })
}

// 删除单元
export function delUnit(id) {
  return request({
    url: `/dormitory/dms-dormitory-unit/delete`,
    method: 'post',
    data: id
  })
}
